Clipboards
Introduction
The clipboard can be understand as a omniexistent cache to store and retrieve data from.
Therefore you can use it to create a sluice between the database and the frontend of your application or just as a simple storage system to store and retrieve non-persistent data.
Clipboard-Properties
A Clipboard-Property represents a slot which is created for storing data. One could imagine it the clipboard as a warehouse whilst each property represents a wooden box, storing antiques and goods of any kind.
So what does this mean for our application?
Well... this opens the possibility to store any kind of antiques and in our case data. We could simply store a number value for a counter thats counts the current amount of selected burgers in an ordering system. Furthermore we could use our clipboard to store a whole list of user information in dedicated wooden boxes for each information and synchronize it with our database.
Entity-Properties
Entity-Properties allow us to communicate with our database via the clipboard. This enables various use-cases and possibilities.
Like earlier said, we could use our clipboard to retrieve data from a form which is built in our own application and then synchronize that said data with our database. This could for example help building a system to register new users for a newsletter system.
For the Clipboard to interact with the entity, we offer functions through the ApiObject, or you can execute specific actions via SourceLinks.
You can set up one or more SourceLinks for the following events:
Select Row
This allows you to respond to the Select-Row event in tables. When a select event is triggered, the data is directly assigned to Clipboard properties with the same name and then immediately passed on to all components that have specified the Clipboard as their source in a SourceLink through the input event.
Currently, this is only supported by the yTable.
Commit Create
When the Clipboard catches a Commit-Create event through the SourceLinks, it attempts to create a new record in the selected entity, using the data from the properties.
Commit Read
When the Clipboard catches a Commit-Read event through the SourceLinks, it attempts to load the record with the RecordID (_id) using the Key property and save the data into properties with the same name.
Commit Update
When the Clipboard catches a Commit-Update event through the SourceLinks, it attempts to save the data in the properties into the record with the RecordID (_id) using the Key property.
Commit Delete
When the Clipboard catches a Commit-Delete event through the SourceLinks, it attempts to delete the record with the RecordID (_id) using the Key property, aiming to remove the data associated with the record.
Currently following events are only supported by the yButton and yLinkButton:
- Commit Create
- Commit Read
- Commit Update
- Commit Delete